package com.policenacorp.ejb.impl;

import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.ejb.Stateless;

import com.policenacorp.ejb.bean.local.RecursosBeanLocal;
import com.policenacorp.ejb.bean.remote.RecursosBeanRemote;

@Stateless
public class RecursosBusiness implements RecursosBeanLocal, RecursosBeanRemote {

	@Resource
	private String publicKey;

	@Resource
	private SessionContext context;

	private void imprimePalavra(final String palavra) {
		System.out
				.println("------------------- Chave injetada -------------------");
		System.out.println(palavra);
		System.out
				.println("------------------- Fim  impressao -------------------");
	}

	@Override
	public void imprimePublicKey() {
		imprimePalavra(publicKey);
		System.out.println("\n");
		imprimePalavra(context.lookup("chaveDecriptografia").toString());
	}
}
